/**
 * axios 统一配置请求处理器
 */
import axios from 'axios';

const service = axios.create({
    baseURL: "/activiti-app",
    timeout: 15000,
    withCredentials: true,
    headers: {
        'X-Requested-With': 'XMLHttpRequest'
    }
})

/**
 * 请求拦截器
 */
service.interceptors.request.use(config => {
    return config
}, error => {
    Promise.reject(error).then(r => {})
})

/**
 * 响应拦截器
 */
service.interceptors.response.use(
    response => {
        return response.data;
    },
    error => {
        window.alert("系统出错了");
        return error
    }
)
export default service
